x86/VPMU: handle PMU interrupts for PV(H) guests
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Thu, 9 Jul 2015 14:48:00 +0000 (16:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jul 2015 14:48:00 +0000 (16:48 +0200)
commit0d67f2568747b7244c70e4d072a54bc0748c8677
treee60031ce1683cd1cb94bce0dea267e16c6e3c008
parent314713c683c6343d2c3156202d5dcc0e139cad05
x86/VPMU: handle PMU interrupts for PV(H) guests

Add support for handling PMU interrupts for PV(H) guests.

VPMU for the interrupted VCPU is unloaded until the guest issues XENPMU_flush
hypercall. This allows the guest to access PMU MSR values that are stored in
VPMU context which is shared between hypervisor and domain, thus avoiding
traps to hypervisor.

Since the interrupt handler may now force VPMU context save (i.e. set
VPMU_CONTEXT_SAVE flag) we need to make changes to amd_vpmu_save() which
until now expected this flag to be set only when the counters were stopped.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
xen/arch/x86/hvm/svm/vpmu.c
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/arch/x86/hvm/vpmu.c
xen/include/asm-x86/hvm/vpmu.h
xen/include/public/arch-x86/pmu.h
xen/include/public/pmu.h
xen/include/xsm/dummy.h
xen/xsm/flask/hooks.c